package com.bjak.dxfreduce;

import lombok.AllArgsConstructor;
import lombok.EqualsAndHashCode;
import lombok.Getter;

import java.math.BigDecimal;

/**
 * Vector for 3 dimension
 *
 * @author wangp
 */
@Getter
@EqualsAndHashCode
public class Vector3 {

    private BigDecimal x;
    private BigDecimal y;
    private BigDecimal z;

    public static Vector3 ZERO = new Vector3(new BigDecimal(0), new BigDecimal(0), new BigDecimal(0));

    public Vector3(String x, String y, String z) {
        this.x = new BigDecimal(x);
        this.y = new BigDecimal(y);
        this.z = new BigDecimal(z);
    }

    public <T extends Number> Vector3(T x, T y, T z) {
        this.x = new BigDecimal(x.toString());
        this.y = new BigDecimal(y.toString());
        this.z = new BigDecimal(z.toString());
    }
}
